import { apiRequest } from "../utils/request";
//根据key查询
export function configKey(configKey: string) {
  return apiRequest({
    url: `/infra/config/configKey/${configKey}`,
    method: "get",
  });
}
//收益明细
export function profitRecordList(data: any): Promise<commonTypes.ApiRowResponse<myTypes.profitRecord>> {
  return apiRequest({
    url: `/profitRecord/list`,
    method: "get",
    data,
  });
}
//我的推广
export function userTeamList(): Promise<commonTypes.ApiResponse<myTypes.TeamData>> {
  return apiRequest({
    url: `/user/team`,
    method: "get",
  });
}
//获取登录用户基本信息
export function getUserInfo(): Promise<commonTypes.ApiResponse<myTypes.userInfo>> {
  return apiRequest({
    url: `/user/userInfo`,
    method: "get",
  });
}
//获取我的名片列表
export function myCardList(): Promise<commonTypes.ApiResponse<myTypes.myCardList>> {
  return apiRequest({
    url: `/card/myCard`,
    method: "get",
  });
}

//创建名片
export function createCard(data: any) {
  return apiRequest({
    url: `/card/createCard`,
    method: "post",
    data,
  });
}

//名片详情
export function getCardInfo(data: any): Promise<commonTypes.ApiResponse<myTypes.cardInfo>> {
  return apiRequest({
    url: `/card/getInfo`,
    method: "post",
    data,
  });
}

//修改名片
export function modifyCard(data: any) {
  return apiRequest({
    url: `/card/modifyCard`,
    method: "post",
    data,
  });
}
//获取所有行业（带分类）
export function getIndustryList(): Promise<commonTypes.ApiResponse<myTypes.indurstyList[]>> {
  return apiRequest({
    url: `/industry/getIndustryList`,
    method: "get",
  });
}
//获取我的行业
export function getMyIndustry(): Promise<commonTypes.ApiResponse<myTypes.myIndustry[]>> {
  return apiRequest({
    url: `/userIndustry/myIndustry`,
    method: "get",
  });
}
//创建修改我的行业
export function createMyIndustry(data: any) {
  return apiRequest({
    url: `/userIndustry/createMyIndustry`,
    method: "post",
    data,
  });
}

//好友列表
export function myFriendsList(): Promise<commonTypes.ApiResponse<myTypes.myFriendsList[]>> {
  return apiRequest({
    url: `/userFriends/myFriends`,
    method: "get",
  });
}

//添加意见反馈
export function createFeedback(data: any) {
  return apiRequest({
    url: `/feedback/createFeedback`,
    method: "post",
    data,
  });
}
//推广二维码
export function getQrCode() {
  return apiRequest({
    url: `/user/qrCode`,
    method: "post",
  });
}
//根据微信临时码绑定手机
export function bindMobileByWxCode(data: any) {
  return apiRequest({
    url: `/user/bindMobileByWxCode`,
    method: "post",
    data,
  });
}

//开通会员
export function openVip() {
  return apiRequest({
    url: `/user/openVip`,
    method: "post",
  });
}
//修改允许添加好友
export function changeAllowAdd(data: any) {
  return apiRequest({
    url: `/user/changeAllowAdd`,
    method: "post",
    data,
  });
}
//修改推送时间
export function changeSendTime(data: any) {
  return apiRequest({
    url: `/user/changeSendTime`,
    method: "post",
    data,
  });
}
//发送验证码
export function sendCode() {
  return apiRequest({
    url: `/user/sendCode`,
    method: "get",
  });
}
//修改支付宝信息
export function setAliAccount(data: any) {
  return apiRequest({
    url: `/user/setAliAccount`,
    method: "post",
    data,
  });
}
//修改支付密码
export function setPayPassword(data: any) {
  return apiRequest({
    url: `/user/setPayPassword`,
    method: "post",
    data,
  });
}
// 获取钱包 / 帖子 / 推广;
export function userCenter() {
  return apiRequest({
    url: `/user/userCenter`,
    method: "get",
  });
}

//提现
export function withdrawal(data: any) {
  return apiRequest({
    url: `/withdrawal`,
    method: "post",
    data,
  });
}

//获取banner
export function getByType(data: any) {
  return apiRequest({
    url: `/news/getByType`,
    method: "get",
    data,
  });
}
//获取banner详情
export function getNewsInfo(data: any) {
  return apiRequest({
    url: `/news/getInfo`,
    method: "get",
    data,
  });
}
//被申请好友记录数量
export function getApplyCount() {
  return apiRequest({
    url: `/userFriends/getApplyCount`,
    method: "get",
  });
}
//申请认证
export function authRecord(data: any) {
  return apiRequest({
    url: `/authRecord/apply`,
    method: "post",
    data,
  });
}

//申请状态
export function applyStatus() {
  return apiRequest({
    url: `/authRecord/applyStatus`,
    method: "get",
  });
}
//获取工厂列表（分页）
export function getFactoryList(data: any) {
  return apiRequest({
    url: `/factory/list`,
    method: "get",
    data,
  });
}

//退出登录
export function logoutApi() {
  return apiRequest({
    url: `/logout`,
    method: "get",
  });
}
